package com.tinshow.config.configuration;

import com.tinshow.config.Interceptor.CookieInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;


/**
 * Created by libo4 on 2017/5/27.
 */
@Configuration
@Component
public class WebMvcConfiguration extends WebMvcConfigurerAdapter{

    @Autowired
    CookieInterceptor cookieInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry){
        System.out.println("===================================================================");
        registry.addInterceptor(cookieInterceptor).addPathPatterns("/login_view");
        super.addInterceptors(registry);
    }


}
